home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / dnet / dnet-snfs-sun4.lha / src / snfs.c-patch / text0000.txt < prev   
Encoding:
Text File  |  1992-11-22  |  2.3 KB  |  81 lines

  1. In article <432469974@bluemoon.GUN.de>, georg@bluemoon.GUN.de (Georg Sassen) writes:
  2. |> In <91256.10163932KKG6I@CMUVM.BITNET> 32KKG6I@CMUVM.BITNET (Jim Getzinger) writes:
  3. |> 
  4. |> >Has anyone been able to make the nfs handler and snfs work on a Sun
  5. |> >Sparc?   I'm able to start snfs in the background and successfully
  6. |> >mount NF0: (or NFS:) but when I do a dir on NF0:, all I get is one
  7. |> >directory entry.  When it is at the root, I get lost+found only.
  8. |> 
  9. |> Yes, there was a problem with alignement of a struct's entries, I think.
  10. |> 
  11. |> >I could not get the snfs.c in the normal dist to connect, but the version
  12. |> >I found at the dnet/. level allowed the connect, but would give me
  13. |> >the above problem.
  14. |> 
  15. |> Yes, in the snfs.c at the dnet/. level, the alignement problem was fixed but
  16. |> something other went wrong.
  17. |> 
  18. |> >Any suggestions?  Thanks in advance!
  19. |> 
  20. |> Try this one (apply it to the origininal snfs.c in dnet/unix/server), it
  21. |> works fine for me:
  22.  
  23. I found that the original dnet/unix/server/snfs.c worked fine on sun3. The
  24. snfs.c at dnet/snfs.c works fine under Ultrix. The problem with dnet/snfs.c
  25. is the lton and ntol funktions. They aren't portable between different
  26. endian systems. For suns they can be replaced with null macros. I have
  27. rewritten the functions to find which endian the excuting machines has, so
  28. that the code works in both cases. Replace the two functions in the end of
  29. the file, and compile! :)
  30.  
  31.          Have fun!
  32.  
  33.  
  34.       Stellan Klebom
  35.  
  36. -----------------------------------------------------------------------------
  37. E-Mail: d88-skl@nada.kth.se, meLazy@lysator.liu.se, melazy@stacken.kth.se
  38.  
  39.  
  40. *****************************************************************************
  41. long
  42. ntol(n)
  43. unsigned long n;
  44. {
  45.     union { unsigned long l; unsigned char b[4];} u;
  46.     unsigned char z;
  47.  
  48.     u.l=1;
  49.     if (u.b[0]) {
  50.         u.l = n;
  51.         z = u.b[0]; u.b[0] = u.b[3]; u.b[3] = z;
  52.         z = u.b[1]; u.b[1] = u.b[2]; u.b[2] = z;
  53.  
  54.         return u.l;
  55.     }
  56.  
  57.     return n;
  58. }
  59.  
  60. long
  61. lton(n)
  62. unsigned long n;
  63. {
  64.     union { unsigned long l; unsigned char b[4];} u;
  65.     unsigned char z;
  66.  
  67.     u.l=1;
  68.     if (u.b[0]) {
  69.         u.l = n;
  70.         z = u.b[0]; u.b[0] = u.b[3]; u.b[3] = z;
  71.         z = u.b[1]; u.b[1] = u.b[2]; u.b[2] = z;
  72.  
  73.         return u.l;
  74.     }
  75.  
  76.     return n;
  77. }
  78.  
  79.  
  80.  
  81.